<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page import="${appConfig.groupId}.controller.ServerProcessStatus" %>
<%@ page import="${appConfig.groupId}.model.${entity.javaName}" %>
<title>${entity.javaName} View</title>
</head>
<body>
<div align="center">
<center><h1>Welcome come to Spring On Rails</h1></center>
<center><b>Brought to you by <a href="http://www.asksunny.com">Sunny Liu</a></b></center>
</div>
<br/>
<div align="center">
<center><h1>${entity.javaName} List View</h1></center>
</div>

<br/>
<#noparse>
<c:if test="${status.hasError}">
  <center><b><pre><c:out value="${status.stackTraceAsString}"/></pre></b></center>
</c:if>
<c:if test="${!empty status.message}">
  <center><b><c:out value="${status.message}"/></b></center>
</c:if>
</#noparse>
<table border="1">
<tr>
<#list entity.attributes as attribute>
<th>${attribute.javaName}</th>
</#list>
<th>UPDATE</th>
<th>DELETE</th>
</tr>
<c:forEach items="<#noparse>${status.output}</#noparse>" var="${entity.normalizedJavaName}" >
<tr>
<#list entity.attributes as attribute>
<#if attribute.dateType >
<td><c:out value="<#noparse>${</#noparse>${entity.normalizedJavaName}.${attribute.javaName}String<#noparse>}</#noparse>"/></td>
<#else>
<td><c:out value="<#noparse>${</#noparse>${entity.normalizedJavaName}.${attribute.javaName}<#noparse>}</#noparse>"/></td>
</#if>
</#list>
<td><a href="${entity.normalizedJavaName}DetailView?<#list entity.primaryKeyColumns as attribute>${attribute.javaName}=<c:out value="<#noparse>${</#noparse>${entity.normalizedJavaName}.${attribute.javaName}<#noparse>}</#noparse>"/><#if attribute_has_next>&</#if></#list>">UPDATE</a>
<td><a href="delete${entity.javaName}?<#list entity.primaryKeyColumns as attribute>${attribute.javaName}=<c:out value="<#noparse>${</#noparse>${entity.normalizedJavaName}.${attribute.javaName}<#noparse>}</#noparse>"/><#if attribute_has_next>&</#if></#list>">DELETE</a>
</tr>
</c:forEach>
</table>
<table>
	<tr>
	<td> <a href="../index.jsp">Home Page</a></td>	
	<td> <a href="${entity.normalizedJavaName}ListView">${entity.javaName} List View</a></td>
	<td> <a href="add${entity.javaName}">Add ${entity.javaName}</a></td>	
	</tr>
</table>
</body>
</html>